const UserStockTag = require('../db/model/user_stock_tag');
const cryptoHelper = require('../helper/crypto');

const add = async (name, code, shortcut) => {

    let record = await UserStockTag.query().insert({
        user_tag_id,
        user_stock_id,
    });

    return record;
};

const get = async (id) => {

    let record = await UserStockTag.query().findOne({id});

    return record;
};

const update = async (id, summary) => {

    let record = await UserStockTag.query().update({summary}).where("id", id);

    return record;
};

const remove = async (id) => {

    let record = await UserStockTag.query().where("id", id).del();

    return record;
};

// //  REBOL todo, pager, limit, 
// const list = async (user_id) => {

//     let record = await UserStockTag.query().select().where("user_id", user_id);

//     return record;
// };

//  REBOL todo, update_batch, use python to write a tool to update price every day.

module.exports = {
    add,
    get,
    update,
    remove,
    //list,
};